package com.wn.access.api;

import com.wn.common.model.dto.bank.BankBidDTO;
import com.wn.common.model.dto.bank.BankCardAddDto;
import com.wn.common.model.dto.bank.BorrowRecordStatusBankDTO;
import com.wn.common.model.vo.borrow.BidBalanceDTO;
import com.wn.common.model.vo.borrow.BorrowRecordVo;
import com.wn.common.model.vo.borrow.LoanVo;
import com.wn.common.model.vo.pay.RepayVo;
import com.wn.common.result.BaseResult;
import com.wn.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author yellow Docter
 * @date 2023 -07-27
 * @desc
 */
@FeignClient(value = "sddfp-bank-access-service",path = "trade")
public interface BankAccessApi {

    @PostMapping("/bank/access/card")
    public Result bankCardAddDto(@RequestBody BankCardAddDto bankCardAddDto);

    /**
     * 借款记录 同步到 银行系统
     * @param bankCardAddDto
     * @return
     */
    @PostMapping("/bank/access/snyc/borrow")
    public Result<BaseResult> syncBorrowRecord(@RequestBody BorrowRecordVo borrowRecordVo);

    /**
     * 查询 银行余额的远程调用
     * @param userCode
     * @return
     */
    @GetMapping("/bank/access/bid/balance/{userCode}")
    BidBalanceDTO getBalanceDetails(@PathVariable("userCode") String userCode);

    @PostMapping("/bank/access/add/agencyBid")
    Result<BaseResult> saveAgencyBid(@RequestBody BankBidDTO bankBidDTO);

    @PostMapping("/bank/access/loan/confirm")
    Result<BaseResult> confirmLoan(@RequestBody LoanVo loanVo);

    @PostMapping("/bank/access/confirm/repay")
    Result<BaseResult> confirmRepay(
            @RequestBody RepayVo repayVo);

    @PostMapping("/bank/access/status")
    Result changeBorrowStatus(@RequestBody BorrowRecordStatusBankDTO borrowRecordStatusBankDTO);

}
